package pe.com.bbva.pct.domain;

import java.io.Serializable;
import java.util.Date;

import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.FetchType;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
import javax.persistence.JoinColumn;
import javax.persistence.ManyToOne;
import javax.persistence.SequenceGenerator;
import javax.persistence.Table;
import javax.persistence.Temporal;
import javax.persistence.TemporalType;

import pe.com.bbva.pct.util.ConstantesGenerales;

@Entity
@Table(name="TMR008_LOG", schema = ConstantesGenerales.DATABASE)
public class Log implements Serializable{

	private static final long serialVersionUID = 4464242944480586972L;
	private Long idLog;
	private Ejecucion idEjecucion;
	private String log;
	private Date fecha;
	
	@Id
	@SequenceGenerator(name="SQ_ID_LOG", sequenceName=ConstantesGenerales.DATABASE+".SQ_ID_LOG", allocationSize = 1)
	@GeneratedValue(strategy=GenerationType.SEQUENCE, generator="SQ_ID_LOG")
	@Column(name="CD_ID_LOG", unique=true, nullable=false, precision=36)	
	public Long getIdLog() {
		return idLog;
	}
	public void setIdLog(Long idLog) {
		this.idLog = idLog;
	}
	
	@ManyToOne(fetch = FetchType.LAZY)
	@JoinColumn(name = "CD_ID_EJECUCION",  nullable=true)
	public Ejecucion getIdEjecucion() {
		return idEjecucion;
	}
	public void setIdEjecucion(Ejecucion idEjecucion) {
		this.idEjecucion = idEjecucion;
	}
	
	@Column(name="TX_LOG", nullable=true)
	public String getLog() {
		return log;
	}

	public void setLog(String log) {
		this.log = log;
	}
	@Temporal(TemporalType.DATE)
	@Column(name="FH_FECHA", length=50,  nullable=true)
	public Date getFecha() {
		return fecha;
	}
	public void setFecha(Date fecha) {
		this.fecha = fecha;
	}
	
	
	
}
